package gfyx_crm_log

import "time"

// CREATE TABLE `gfyx_crm_log` (
//  `uid` char(36) NOT NULL COMMENT '主键，uuid',
//  `business_uid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '当business_type为0时，对应gfyx_report表的uid；当business_type为1时，对应clue表的ClueGUID；',
//  `business_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '对应业务类型，0-报备，对应gfyx_report表; 1-线索，对应clue表',
//  `url` varchar(255) NOT NULL DEFAULT '' COMMENT "第三方crm系统的创建线索url",
//  `header` varchar(255) NOT NULL DEFAULT '' COMMENT "请求头",
//  `body` varchar(2048) NOT NULL DEFAULT '' COMMENT "请求体",
//  `response` varchar(2048) NOT NULL DEFAULT '' COMMENT "响应体",
//  `spend_time` int NOT NULL DEFAULT 0 COMMENT "请求耗时，单位毫秒ms",
//  `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT "请求状态，0-成功 1-失败",
//  `retry_times` int NOT NULL DEFAULT 0 COMMENT "重试次数",
//  `retry_time` datetime NOT NULL DEFAULT 0 COMMENT "最后一次重试时间",
//  `created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT "记录创建时间",
//  `created_by` varchar(40) NOT NULL DEFAULT '' COMMENT "记录创建人",
//  `modified_on` datetime NOT NULL COMMENT "记录更新时间",
//  `modified_by` varchar(40) NOT NULL DEFAULT '' COMMENT "记录更新人",
//  `is_deleted` tinyint(1) NOT NULL DEFAULT '0'  COMMENT "软删除字段，0-正常记录，1-已删除",
//  PRIMARY KEY (`uid`)
//) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='请求第三方crm系统日志表';

type GfyxCrmLogPo struct {
	Uid          string `gorm:"primary_key"`
	BusinessUid  string
	BusinessType int32
	Url          string
	Header       string
	Body         string
	Response     string
	SpendTime    int64
	Status       int32
	RetryTimes   int32
	RetryTime    time.Time
	CreatedOn    time.Time
	CreatedBy    string
	ModifiedOn   time.Time
	ModifiedBy   string
	IsDeleted    int32
}

func (po GfyxCrmLogPo) TableName() string {
	return "gfyx_crm_log"
}
